]> dgit.raspbian.org Git - fontforge.git/commit
Fix non-reproducible TrueType hinting: invalid qsort comparators
authorBastian Germann <bage@debian.org>
Sun, 11 Oct 2026 21:59:36 +0000 (23:59 +0200)
committerBastian Germann <bage@debian.org>
Mon, 12 Oct 2026 22:15:54 +0000 (00:15 +0200)
commita892d9eb500555b259e51dba6d0f6a7db1ea8f33
tree8334d6d944d0fa1b93e0c3bde176e9601c54e955
parent1a0fe0ef1d88d4c6cd6f70ccd0539ae9457a03c0
Fix non-reproducible TrueType hinting: invalid qsort comparators

Several comparison functions passed to qsort() violated the ordering
axioms. With glibc >= 2.37 qsort() takes an in-place introsort path that
has undefined behaviour for such comparators and reads uninitialised
memory, so the generated TrueType instructions varied between builds
(e.g. FreeSerif.ttf from the GNU FreeFont sources).

Make SortBlues(), SortStems(), sortbynum(), sortedges(), stem_cmp() and
line_pt_cmp() return a proper trichotomous result and compare both
arguments symmetrically.

Gbp-Pq: Name 0004-qsort-comparators.patch
fontforge/nowakowskittfinstr.c
fontforge/stemdb.c